{% extends "base.html" %}

{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}

{% block content %}
<h1>Login</h1>

<form name="login" action="." method="post">
	{% csrf_token %}
	<table>
		{% for field in form %}
        <tr>
        	<td>{{ field.label_tag }}</td>
          	<td>{{ field }}{% if field.errors %} <strong>{{ field.errors }}</strong>{% endif %}</td>
        </tr>
		{% endfor %}
		<tr><td><input type="submit" value="Login"></td>
			<td><a href="/register" alt="Create a new user" style="padding-left: 50px">Register</a></td>
		</tr>
	</table>
	<input type="hidden" name="next" value="/profile">
</form>
{% endblock %}
